package com.example.wordtris;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class WordtrisDatabaseHelper  extends
SQLiteOpenHelper {
private static final String DB_NAME = "wordtris.db";
private static final int DB_VERSION = 1;
public WordtrisDatabaseHelper(Context context) {
super(context, DB_NAME, null, DB_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
	String sql = "";
	sql += "CREATE TABLE lingua (idLingua INTEGER PRIMARY KEY,lingua TEXT NOT NULL)";
	db.execSQL(sql);
	String sql1 = "";
	sql1 += "CREATE TABLE lingueSupportate (idLinguaSupportata INTEGER PRIMARY KEY,nomeLingua TEXT NOT NULL,codiceLingua TEXT NOT NULL)";
	db.execSQL(sql1);
	String sql2 = "";
	sql2 += "INSERT INTO lingueSupportate (nomeLingua,codiceLingua) VALUES (\"ITALIANO\",\"it\")";
	db.execSQL(sql2);
	String sql3 = "";
	sql3 += "INSERT INTO lingueSupportate (nomeLingua,codiceLingua) VALUES (\"ENGLISH\",\"en\")";
	db.execSQL(sql3);
	String sql4 = "";
	sql4 += "INSERT INTO lingueSupportate (nomeLingua,codiceLingua) VALUES (\"ESPAGNOL\",\"es\")";
	db.execSQL(sql4);
	String sql5 = "";
	sql5 += "CREATE TABLE nick (idNick INTEGER PRIMARY KEY,nickName TEXT NOT NULL)";
	db.execSQL(sql5);
	String sql6 = "";
	sql6 += "INSERT INTO nick (nickName) VALUES (\"JOHN DOE\")";
	db.execSQL(sql6);
}
@Override
public void onUpgrade(SQLiteDatabase db,
int oldVersion, int newVersion) {

}
}
